<template>
  <div>
    <div class="box">
        <h2>这个是counter组件 ---{{count}}</h2>
        <button @click="add">count+1</button>
    </div>
  </div>
</template>

<script>
export default {
    name:'Counter',
    data(){
        return{
            count:1,
            age:2
        }
    },
        methods:{
            add(){
                this.count+=1
            },
            reset(){
                this.count=0
            }
        }

}
</script>

<style lang="less">
.box{
    border: 1px solid #efefef;
}
</style>